package lanqiao;
/**
 * @Project : AlgorithmLearning
 * @Package : LanQiao.PrepareForCompetition
 * @File : Q1447.java
 * @Author : WangRuoyu
 * @Date : 2023/3/28 11:09
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Q1447 {

    static int n;
    static int[] d;
    static int sum = 0;
    static boolean[][] f;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] words = br.readLine().split(" ");
        n = Integer.parseInt(words[0]);
        d = new int[n];
        words = br.readLine().split(" ");
        for (int i = 0; i < n; ++i) {
            d[i] = Integer.parseInt(words[i]);
            sum += d[i];
        }
        f = new boolean[n + 1][2 * sum + 1];
        f[0][sum] = true;
        for (int i = 1; i <= n; ++i) {
            for (int j = 0; j < 2 * sum + 1; ++j) {
                f[i][j] |= f[i - 1][j];
                if (j >= d[i - 1]) f[i][j] |= f[i - 1][j - d[i - 1]];
                if (j + d[i - 1] < 2 * sum + 1) f[i][j] |= f[i - 1][j + d[i - 1]];
            }
        }
        int res = 0;
        for (int i = sum + 1; i < 2 * sum + 1; ++i) {
            if (f[n][i]) res++;
        }
        System.out.println(res);
    }
}
